package com.sinosoft.dsp.persistence.businessconcept.atom;

/**
 * 时间范围对象
 * 
 * @author 潘巍（Peter Pan）
 * @since 2011-4-23 下午03:53:03
 */
public class SinoDurationBean implements ISinoRangeAtomType {

	// 最小值
	private Long min;

	// 最大值
	private Long max;

	// 是否包含最小值
	private boolean includeLower;

	// 是否包含最大值
	private boolean includeUpper;

	public Long getMin() {
		if (min == null) {
			return Long.MIN_VALUE;
		}
		return min;
	}

	public SinoDurationBean setMin(Long min) {
		this.min = min;
		return this;
	}

	public Long getMax() {
		if (max == null) {
			return Long.MAX_VALUE;
		}
		return max;
	}

	public SinoDurationBean setMax(Long max) {
		this.max = max;
		return this;
	}

	public boolean isIncludeLower() {
		return includeLower;
	}

	public void setIncludeLower(boolean includeLower) {
		this.includeLower = includeLower;
	}

	public boolean isIncludeUpper() {
		return includeUpper;
	}

	public void setIncludeUpper(boolean includeUpper) {
		this.includeUpper = includeUpper;
	}

	@Override
	public boolean isEmpty() {
		return (this.min == null && this.max == null);
	}

	@Override
	public boolean hasLower() {
		return this.min != null;
	}

	@Override
	public boolean hasUpper() {
		return this.max != null;
	}

}
